﻿<UserControl x:Class="Bookvar.UI.HyperlinkButton"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:commands="clr-namespace:Bookvar.UI.Commands"
	xmlns:converters="clr-namespace:Bookvar.UI.Converters"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    DataContext="{Binding Topic, RelativeSource={x:Static RelativeSource.Self}}">

    <UserControl.Resources>
        <converters:UriToImageSourceConverter x:Key="converter"></converters:UriToImageSourceConverter>
        <Style TargetType="Button" x:Key="HyperlinkButton">
            <Setter Property="Width" Value="25"></Setter>
            <Setter Property="Height" Value="25"></Setter>
            <Setter Property="Background" Value="Transparent"></Setter>
        </Style>
    </UserControl.Resources>

    <Button Command="commands:BookvarCommands.NavigateToHyperlink" CommandParameter="{Binding}" Style="{StaticResource HyperlinkButton}"
        ToolTipService.ShowDuration="10000">
        <Button.ToolTip>
            <Image Source="{Binding Path=Hyperlink, Converter={StaticResource converter}}" />
        </Button.ToolTip>
        <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/32x32/ie32.png" Width="16" Height="16" />
    </Button>

</UserControl>
